package utils.file;

import java.util.Date;

/**
 * description: <br>
 * createTime: 2018/5/2516:03 <br>
 *
 * @author zzh
 */
public class FileInfo {

    /**
     * 文件名
     */
    String fileName;

    /**
     * 是否是文件夹
     */
    boolean isDirectory;

    /**
     * 最后修改日期
     */
    Date modifyDate;

    /**
     * 文件长度
     */
    long length;


    public String getFileName() {
        return fileName;
    }


    public FileInfo setFileName(String fileName) {
        this.fileName = fileName;
        return this;
    }


    public boolean isDirectory() {
        return isDirectory;
    }


    public FileInfo setDirectory(boolean directory) {
        isDirectory = directory;
        return this;
    }


    public Date getModifyDate() {
        return modifyDate;
    }


    public FileInfo setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
        return this;
    }


    public long getLength() {
        return length;
    }


    public FileInfo setLength(long length) {
        this.length = length;
        return this;
    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"fileName\":\"")
                .append(fileName).append('\"');
        sb.append(",\"isDirectory\":")
                .append(isDirectory);
        sb.append(",\"modifyDate\":\"")
                .append(modifyDate).append('\"');
        sb.append(",\"length\":")
                .append(length);
        sb.append('}');
        return sb.toString();
    }
}
